p == compose(fst, m);
q == compose(snd, m);
